package ai.peanut.one.api.mq.mqTestTopic;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
import com.rabbitmq.client.Channel;

import javax.annotation.Resource;

@Component
@RabbitListener(queues = TopicTestConfig.dispearQuueName)
public class TopicListen1 {

    @RabbitHandler
    public void process(String hello,Channel channel, Message message) {
        try {
            System.out.println("1111111111111: " + hello);
//            Integer.parseInt("aa");
            channel.basicAck(message.getMessageProperties().getDeliveryTag(),false) ;
        }catch (Exception e ) {
            System.out.println("错误错误");
        }

    }
}
